<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGroupTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('group', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id');
            $table->string('title')->comment('标题');
            $table->smallInteger('post_count')->comment('贴子数');
            $table->boolean('status')->comment('状态');
            $table->smallInteger('sort')->comment('排序');
            $table->string('logo')->comment('群组图标');
            $table->string('background')->comment('群组封面');
            $table->integer('type_id')->comment('分类id');
            $table->text('detail')->comment('详情');
            $table->tinyInteger('type')->comment('圈子类型，0为公共的，1为私有的');
            $table->integer('activity')->comment('活跃度');
            $table->integer('member_count')->comment('成员数');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('group');
    }
}
